<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use App\Http\Controllers\Web\NewsController;
use App\Http\Controllers\Web\ProductsController;
use App\Http\Controllers\Web\TeamsController;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\Web\CustomsController;
use App\Http\Controllers\Web\CompanyController;
use App\Http\Controllers\Web\WebSiteConfigController;
use App\Http\Controllers\Web\UsersController;
use App\Http\Controllers\Web\CompanyDevelopmentHistoryController;
use App\Http\Controllers\Web\FileController;
use App\Http\Controllers\Web\BannersController;
use App\Http\Controllers\Web\ProductsChildrenController;
use App\Http\Controllers\Web\CertificateController;
use App\Http\Controllers\Web\ContactsController;

Route::group(['prefix' => 'api'], function () {
    Route::resource('news', NewsController::class);
    Route::resource('products', ProductsController::class);
    Route::resource('teams', TeamsController::class);
    Route::resource('customs', CustomsController::class);
    Route::get('company', [CompanyController::class, 'index']);
    Route::post('company', [CompanyController::class, 'update']);
    Route::get('webSite', [WebSiteConfigController::class, 'index']);
    Route::post('webSite', [WebSiteConfigController::class, 'update']);
    Route::post('register', [AuthController::class, 'register']);
    Route::post('login', [AuthController::class, 'login']);
    Route::post('logout', [AuthController::class, 'logout']);
    Route::post('refresh', [AuthController::class, 'refresh']);
    Route::get('user', [AuthController::class, 'user']);
    Route::resource('users', UsersController::class);
    Route::resource('banners', BannersController::class);
    Route::resource('productsChildren', ProductsChildrenController::class);
    Route::resource('contacts', ContactsController::class);
    Route::resource('certificate', CertificateController::class);
    Route::resource('companyDevelopmentHistory', CompanyDevelopmentHistoryController::class);
    Route::post('uploadImg', [FileController::class, 'uploadImg']);
    Route::get('getImg', [FileController::class, 'getImg']);
    Route::get('getBasePath', [FileController::class, 'getBasePath']);
});



